

import 'package:bt_tool/basic/bt_notification_center.dart';
import 'package:flutter/services.dart';

class AppBridgeTool {

  static const _platform = MethodChannel('btMacos');

  static AppBridgeTool? _instance;

  static AppBridgeTool share(){
    _instance ??= AppBridgeTool._internal();
    return _instance!;
  }

  AppBridgeTool._internal();

  register(){
    _platform.setMethodCallHandler((call) async {
      if (call.method == "createTranslateDataCopy") {
        BTNotificationCenter.share().postNotify("createTranslateDataCopy");
        return "";
      }



      return "";
    });
  }

  static Future<void> createTranslateSucNotify(String content) async {
    final result = await _platform.invokeMethod('TranslateCreateSucNotify',content);
  }

  static Future<void> createTranslateReapetNotify(String content) async {
    final result = await _platform.invokeMethod('TranslateCreateReapetNotify',content);
  }

}